import pdfplumber
with pdfplumber.open("example1.pdf") as pdf:
    # first_page = pdf.pages[0]
    # print(first_page.extract_text())  # 文本
    # print(first_page.extract_table()) # 表格
    for i in range(len(pdf.pages)):
        print(f'第{i+1}页')
        f_page = pdf.pages[i]
        if f_page.extract_text():
            print(f_page.extract_text())
        if f_page.extract_table():
            print(f_page.extract_table())

